const express = require('express')
const app = express()

const nw1 = function (req, res, next) {
    console.log('调用了局部生效的中间件')
    next()
}

// nw1只会在当前文件生效
app.get('/', nw1, (req, res) => {
    console.log('调用了这个路由')//后
    res.send('hhh')
})


app.get('/user', (req, res) => {
    res.send('USER PAGE.')
})


app.listen('80', () => {
    console.log('http://127.0.0.1')
})